/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-02-20 12:34:53
 * @LastEditors: Clark
 * @LastEditTime: 2023-02-20 12:37:46
 * @Description: file content
 */

#include "opend.h"
#include <syslog.h>

char errmsg[MAXLINE];
char *pathname;

int main(int argc, char *argv[])
{
    int nread;
    char buf[MAXLINE];

    while (1)
    {
        if ((nread = read(STDIN_FILENO, buf, MAXLINE)) < 0)
        {
            err_sys("read error on stream pipe");
        }
        else if (0 == nread)
        {
            break;
        }

        handle_request(buf, nread, STDOUT_FILENO);
    }

    exit(0);
}
